;******************************************* ;Written By: Matthew Harrison * ;Date: 21/12/06 * ;Version: 1.0 * ;Project Name: PIC Christmas Tree * ;Microprocessor: PIC 16F84A * ;Clock Frequency: 8 MHz * ;******************************************* ;PROGRAM FUNCTION: PICMCU controlled Christmas Tree ; with 20 LED Matrix and HCF4015 Shift Register. list P=16F84A include p16F84A.inc ;========================================= ;Declarations: porta equ 05 portb equ 06 ;mark144 equ 0C mark24 equ 0D mark16 equ 0E mark4 equ 10 post150 equ 11 post88 equ 12 post44 equ 13 post22 equ 14 post8 equ 15 post5 equ 16 post4 equ 17 post3 equ 19 g_led equ 1A #define clk porta,2 ; HCF4015B clock pin #define d_in porta,3 ; HCF4015B data in pin #define rst porta,1 ; HCF4015B chip Reset pin org 0 goto start ;========================================= ;Subroutines: Init clrf porta ;resets I/O ports clrf portb bsf STATUS,5 ; selects bank 1. movlw b'00001' ; RA0: SW1, RA1: 4015_RST(A&B), RA2: 4015_CLK(A&B), movwf TRISA ; RA3: 4015_DATA(A&B), RA4: Q9. movlw b'00000000' ; RB0 - RB7: For controlling transistors Q1 - Q8 movwf TRISB ; on the LED Matrix. movlw b'00000111' ; TMR0 prescaled by 256 movwf OPTION_REG ; pull ups disabled. bcf STATUS,5 ; selects bank 0. movlw b'00000000' ; disables all interrupts. movwf INTCON ; bsf rst ; sets both RST_A & RST_B resetting HCF4015B. bcf rst ; clears both RST_A & RST_B pins on HCF4015B. ; movlw d'144' ; moves the decimal No144 into the GPF called ; movwf mark144 ; mark64, the marker for one952sec32. movlw d'24' ; moves the decimal No24 into the GPF called movwf mark24 ; mark24, the marker for one952sec6. movlw d'16' ; moves the decimal No16 into the GPF called movwf mark16 ; mark16, the marker for one952sec4. movlw d'4' ; moves the decimal No4 into the GPF called mark4. movwf mark4 ; mark4, the marker for one952sec. call resetpost150 ; resets post150 register. call resetpost88 ; resets post88 register. call resetpost44 ; resets post22 register. call resetpost22 ; resets post22 register. call resetpost8 ; resets post8 register. call resetpost5 ; resets post5 register. retlw 0 one952sec clrf TMR0 ; resets TMR0. one952sec1 movfw mark4 ; takes the number out of mark4. subwf TMR0,w ; subtracts this number from the number ; in TMR0, leaving the result in the ; working register (and leaving TMR0 unchanged). btfss STATUS,Z ; tests the zero flag - skip if set i.e. if the ; result is zero it will skip the next instruction. goto one952sec1 ; loops to one952sec1. return ; returns from subroutine. one952sec4 clrf TMR0 ; resets TMR0. one952sec4_1 movfw mark16 ; takes the number out of mark16. subwf TMR0,w ; subtracts this number from the number ; in TMR0, leaving the result in the ; working register (and leaving TMR0 unchanged) btfss STATUS,Z ; tests the zero flag - skip if set i.e. if the ; result is zero it will skip the next instruction. goto one952sec4_1 ; loops to one952sec4_1. return ; returns from subroutine. one952sec5 call one952sec ; creates a 1/1952sec delay. call one952sec4 ; creates a 4/1952sec delay. return ; returns from subroutine. one952sec6 clrf TMR0 ; resets TMR0. one952sec6_1 movfw mark24 ; takes the number out of mark24. subwf TMR0,w ; subtracts this number from the number ; in TMR0, leaving the result in the ; working register (and leaving TMR0 unchanged) btfss STATUS,Z ; tests the zero flag - skip if set i.e. if the ; result is zero it will skip the next instruction. goto one952sec6_1 ; loops to one952sec6_1. return ; returns from subroutine. one952sec9 call one952sec5 ; creates a 5/1952sec delay. call one952sec4 ; creates a 4/1952sec delay. return one952sec15 call one952sec5 ; creates a 5/1952sec delay. call one952sec5 ; creates a 5/1952sec delay. call one952sec5 ; creates a 5/1952sec delay. return one952sec12 call one952sec6 ; creates a 6/1952sec delay. call one952sec6 ; creates a 6/1952sec delay. return ; returns from subroutine. one952sec19 call one952sec5 ; creates a 5/1952sec delay. call one952sec5 ; creates a 5/1952sec delay. call one952sec5 ; creates a 5/1952sec delay. call one952sec4 ; creates a 4/1952sec delay. return ; returns from subroutine. ledd1 movlw b'00010001' ; moves code into portb to switch D1 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd2 movlw b'00100001' ; moves code into portb to switch D2 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd3 movlw b'01000001' ; moves code into portb to switch D3 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ;ledd4 movlw b'10000001' ; moves code into portb to switch D4 on. ; movwf portb ; ; bsf porta,4 ; ; call one952sec ; creates a 1/1952sec delay. ; clrf portb ; switches LEDs off. ; return ; returns from subroutine. ;ledd5 movlw b'00000001' ; moves code into portb to switch D5 on. ; movwf portb ; ; bcf porta,4 ; ; call one952sec ; creates a 1/1952sec delay. ; clrf portb ; switches LEDs off. ; return ; returns from subroutine. ledd6 movlw b'00010010' ; moves code into portb to switch D6 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd7 movlw b'00100010' ; moves code into portb to switch D7 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd8 movlw b'01000010' ; moves code into portb to switch D8 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ;ledd9 movlw b'10000010' ; moves code into portb to switch D9 on. ; movwf portb ; ; bsf porta,4 ; ; call one952sec ; creates a 1/1952sec delay. ; clrf portb ; switches LEDs off. ; return ; returns from subroutine. ;ledd10 movlw b'00000010' ; moves code into portb to switch D10 on. ; movwf portb ; ; bcf porta,4 ; ; call one952sec ; creates a 1/1952sec delay. ; clrf portb ; switches LEDs off. ; return ; returns from subroutine. ledd11 movlw b'00010100' ; moves code into portb to switch D11 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd12 movlw b'00100100' ; moves code into portb to switch D12 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd13 movlw b'01000100' ; moves code into portb to switch D13 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd14 movlw b'10000100' ; moves code into portb to switch D14 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd15 movlw b'00000100' ; moves code into portb to switch D15 on. movwf portb ; bcf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd16 movlw b'00011000' ; moves code into portb to switch D16 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd17 movlw b'00101000' ; moves code into portb to switch D17 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd18 movlw b'01001000' ; moves code into portb to switch D18 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ledd19 movlw b'10001000' ; moves code into portb to switch D19 on. movwf portb ; bsf porta,4 ; call one952sec ; creates a 1/1952sec delay. clrf portb ; switches LEDs off. return ; returns from subroutine. ;ledd20 movlw b'00001000' ; moves code into portb to switch D20 on. ; movwf portb ; ; bcf porta,4 ; ; call one952sec ; creates a 1/1952sec delay. ; clrf portb ; switches LEDs off. ; return ; returns from subroutine. led_seq01 call ledd11 ; call ledd15 ; call ledd17 ; return ; returns from subroutine. led_seq02 call ledd12 ; call ledd14 ; call ledd18 ; return ; returns from subroutine. led_seq03 call ledd13 ; call ledd16 ; call ledd19 ; return ; returns from subroutine. led_seq04 call ledd1 ; call ledd2 ; call ledd3 ; return ; returns from subroutine. led_seq05 call ledd6 ; call ledd7 ; call ledd8 ; return ; returns from subroutine. d_high bsf d_in ; Places a logic high onto both Data_A & Data_B. bsf clk ; High clock pulse. call one952sec ; creates a 1/1952sec delay. return ; returns from subroutine. d_low bcf d_in ; Places a logic low onto both Data_A & Data_B. bsf clk ; High clock pulse. call one952sec ; creates a 1/1952sec delay. return ; returns from subroutine. resetpost5 movlw d'5' ; resets post5 by moving the No5 back into it. movwf post5 ; return ; returns from subroutine. resetpost8 movlw d'8' ; resets post8 by moving the No8 back into it. movwf post8 ; return ; returns from subroutine. resetpost22 movlw d'22' ; resets post22 by moving the No16 back into it. movwf post22 ; return ; returns from subroutine. resetpost44 movlw d'44' ; resets post44 by moving the No32 back into it. movwf post44 ; return ; returns from subroutine. resetpost88 movlw d'88' ; resets post88 by moving the No128 back into it. movwf post88 ; return ; returns from subroutine. resetpost150 movlw d'150' ; resets post80 by moving the No80 back into it. movwf post150 ; return ; returns from subroutine. ;========================================= ;Program Start: start call Init Main OLTB01 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction goto OLTB01 ; if result is zero. Loops to OLTB01 if not. call resetpost44 ; OLTB01a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB01a ; if result is zero. Loops to OLTB01a if not. call resetpost8 ; bcf clk ; OLTB02 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB02 ; if result is zero. Loops to OLTB02 if not. call resetpost44 ; OLTB02a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB02a ; if result is zero. Loops to OLTB02a if not. call resetpost8 ; bcf clk ; OLTB03 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB03 ; if result is zero. Loops to OLTB03 if not. call resetpost44 ; OLTB03a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB03a ; if result is zero. Loops to OLTB03a if not. call resetpost8 ; bcf clk ; OLTB04 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB04 ; if result is zero. Loops to OLTOB04 if not. call resetpost22 ; OLTB04a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB04a ; if result is zero. Loops to OLTB04a if not. call resetpost8 ; bcf clk ; OLTB05 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB05 ; if result is zero. Loops to OLTB05 if not. call resetpost22 ; OLTB05a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB05a ; if result is zero. Loops to OLTB05a if not. call resetpost8 ; bcf clk ; OLTB06 call led_seq02 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB06 ; if result is zero. Loops to OLTB06 if not. call resetpost44 ; OLTB06a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB06a ; if result is zero. Loops to OLTB06a if not. call resetpost8 ; bcf clk ; OLTB07 call led_seq03 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB07 ; if result is zero. Loops to OLTB07 if not. call resetpost44 ; OLTB07a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB07a ; if result is zero. Loops to OLTB07a if not. call resetpost8 ; bcf clk ; OLTB08 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB08 ; if result is zero. Loops to OLTB08 if not. call resetpost22 ; OLTB08a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB08a ; if result is zero. Loops to OLTB08a if not. call resetpost8 ; bcf clk ; OLTB09 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB09 ; if result is zero. Loops to OLTB09 if not. call resetpost22 ; OLTB09a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB09a ; if result is zero. Loops to OLTB09a if not. call resetpost8 ; bcf clk ; OLTB10 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB10 ; if result is zero. Loops to OLTB10 if not. call resetpost44 ; OLTB10a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB10a ; if result is zero. Loops to OLTB10a if not. call resetpost8 bcf clk ; OLTB11 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB11 ; if result is zero. Loops to OLTB11 if not. call resetpost44 ; OLTB11a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB11a ; if result is zero. Loops to OLTB11a if not. call resetpost8 bcf clk ; OLTB12 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB12 ; if result is zero. Loops to OLTB12 if not. call resetpost44 ; OLTB12a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instructionn goto OLTB12a ; if result is zero. Loops to OLTB12a if not. call resetpost8 ; bcf clk ; OLTB13 call led_seq02 ; call led_seq04 ; call led_seq05 ; call d_low ; call one952sec9 ; creates a 9/1952sec delay. decfsz post88,f ; decrements post88 and skips the next instruction. goto OLTB13 ; if result is zero. Loops to OLTB13 if not. call resetpost88 ; OLTB13a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB13a ; if result is zero. Loops to OLTB13a if not. call resetpost8 ; bcf clk ; OLTB14 call led_seq03 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB14 ; if result is zero. Loops to OLTB14 if not. call resetpost22 ; OLTB14a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB14a ; if result is zero. Loops to OLTB14a if not. call resetpost8 ; bcf clk ; OLTB15 call led_seq03 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB15 ; if result is zero. Loops to OLTB15 if not. call resetpost22 ; OLTB15a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post22 and skips the next instruction goto OLTB15a ; if result is zero. Loops to OLTB15a if not. call resetpost8 ; bcf clk ; OLTB16 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB16 ; if result is zero. Loops to OLTB16 if not. call resetpost44 ; OLTB16a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB16a ; if result is zero. Loops to OLTB16a if not. call resetpost8 ; bcf clk ; OLTB17 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB17 ; if result is zero. Loops to OLTB17 if not. call resetpost44 ; OLTB17a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB17a ; if result is zero. Loops to OLTB17a if not. call resetpost8 ; bcf clk ; OLTB18 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB18 ; if result is zero. Loops to OLTB18 if not. call resetpost44 ; OLTB18a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB18a ; if result is zero. Loops to OLTB17a if not. call resetpost8 ; bcf clk ; OLTB19 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB19 ; if result is zero. Loops to OLTB19 if not. call resetpost44 ; OLTB19a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB19a ; if result is zero. Loops to OLTB19a if not. call resetpost8 ; bcf clk ; OLTB20 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB20 ; if result is zero. Loops to OLTB20 if not. call resetpost44 ; OLTB20a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instructionn goto OLTB20a ; if result is zero. Loops to OLTB20a if not. call resetpost8 ; bcf clk ; OLTB21 call led_seq03 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB21 ; if result is zero. Loops to OLTB21 if not. call resetpost22 ; OLTB21a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB21a ; if result is zero. Loops to OLTB21a if not. call resetpost8 ; bcf clk ; OLTB22 call led_seq03 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB22 ; if result is zero. Loops to OLTB22 if not. call resetpost22 ; OLTB22a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post22 and skips the next instruction goto OLTB22a ; if result is zero. Loops to OLTB22a if not. call resetpost8 ; bcf clk ; OLTB23 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB23 ; if result is zero. Loops to OLTB23 if not. call resetpost44 ; OLTB23a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB23a ; if result is zero. Loops to OLTB23a if not. call resetpost8 ; bcf clk ; OLTB24 call led_seq02 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB24 ; if result is zero. Loops to OLTB24 if not. call resetpost44 ; OLTB24a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB24a ; if result is zero. Loops to OLTB24a if not. call resetpost8 ; bcf clk ; OLTB25 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB25 ; if result is zero. Loops to OLTB25 if not. call resetpost44 ; OLTB25a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB25a ; if result is zero. Loops to OLTB25a if not. call resetpost8 ; bcf clk ; OLTB26 call led_seq01 ; call led_seq04 ; call led_seq05 ; call d_high ; call one952sec9 ; creates a 9/1952sec delay. decfsz post88,f ; decrements post88 and skips the next instruction. goto OLTB26 ; if result is zero. Loops to OLTB26 if not. call resetpost88 ; OLTB26a call one952sec19 ; creates a 19/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction goto OLTB26a ; if result is zero. Loops to OLTB26a if not. call resetpost22 ; bcf clk ; OLTB27 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB27 ; if result is zero. Loops to OLTB27 if not. call resetpost44 ; OLTB27a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB27a ; if result is zero. Loops to OLTB27a if not. call resetpost8 ; bcf clk ; OLTB28 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB28 ; if result is zero. Loops to OLTB28 if not. call resetpost44 ; OLTB28a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB28a ; if result is zero. Loops to OLTB28a if not. call resetpost8 ; bcf clk ; OLTB29 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB29 ; if result is zero. Loops to OLTB29 if not. call resetpost44 ; OLTB29a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB29a ; if result is zero. Loops to OLTB29a if not. call resetpost8 ; bcf clk ; OLTB30 call led_seq02 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB30 ; if result is zero. Loops to OLTB30 if not. call resetpost22 ; OLTB30a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post22 and skips the next instruction goto OLTB30a ; if result is zero. Loops to OLTB30a if not. call resetpost8 ; bcf clk ; OLTB31 call led_seq02 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB31 ; if result is zero. Loops to OLTB31 if not. call resetpost22 ; OLTB31a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post22 and skips the next instruction goto OLTB31a ; if result is zero. Loops to OLTB31a if not. call resetpost8 ; bcf clk ; OLTB32 call led_seq03 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB32 ; if result is zero. Loops to OLTB32 if not. call resetpost44 ; OLTB32a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB32a ; if result is zero. Loops to OLTB32a if not. call resetpost8 ; bcf clk ; OLTB33 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB33 ; if result is zero. Loops to OLTB33 if not. call resetpost44 ; OLTB33a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB33a ; if result is zero. Loops to OLTB33a if not. call resetpost8 ; bcf clk ; OLTB34 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB34 ; if result is zero. Loops to OLTB34 if not. call resetpost22 ; OLTB34a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB34a ; if result is zero. Loops to OLTB34a if not. call resetpost8 ; bcf clk ; OLTB35 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB35 ; if result is zero. Loops to OLTB35 if not. call resetpost22 ; OLTB35a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB35a ; if result is zero. Loops to OLTB35a if not. call resetpost8 ; bcf clk ; OLTB36 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB36 ; if result is zero. Loops to OLTB36 if not. call resetpost44 ; OLTB36a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB36a ; if result is zero. Loops to OLTB36a if not. call resetpost8 ; bcf clk ; OLTB37 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB37 ; if result is zero. Loops to OLTB37 if not. call resetpost44 ; OLTB37a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB37a ; if result is zero. Loops to OLTB37a if not. call resetpost8 ; bcf clk ; OLTB38 call led_seq02 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB38 ; if result is zero. Loops to OLTB38 if not. call resetpost44 ; OLTB38a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instructionn goto OLTB38a ; if result is zero. Loops to OLTB38a if not. call resetpost8 ; bcf clk ; OLTB39 call led_seq03 ; call led_seq04 ; call led_seq05 ; call d_low ; call one952sec9 ; creates a 9/1952sec delay. decfsz post88,f ; decrements post88 and skips the next instruction. goto OLTB39 ; if result is zero. Loops to OLTB39 if not. call resetpost88 ; OLTB39a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB39a ; if result is zero. Loops to OLTB39a if not. call resetpost8 ; bcf clk ; OLTB40 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB40 ; if result is zero. Loops to OLTB40 if not. call resetpost22 ; OLTB40a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB40a ; if result is zero. Loops to OLTB40a if not. call resetpost8 ; bcf clk ; OLTB41 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB41 ; if result is zero. Loops to OLTB41 if not. call resetpost22 ; OLTB41a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB41a ; if result is zero. Loops to OLTB41a if not. call resetpost8 ; bcf clk ; OLTB42 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB42 ; if result is zero. Loops to OLTB42 if not. call resetpost44 ; OLTB42a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB42a ; if result is zero. Loops to OLTB42a if not. call resetpost8 ; bcf clk ; OLTB43 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB43 ; if result is zero. Loops to OLTB43 if not. call resetpost44 ; OLTB43a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB43a ; if result is zero. Loops to OLTB43a if not. call resetpost8 ; bcf clk ; OLTB44 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB44 ; if result is zero. Loops to OLTB44 if not. call resetpost44 ; OLTB44a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB44a ; if result is zero. Loops to OLTB44a if not. call resetpost8 ; bcf clk ; OLTB45 call led_seq02 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB45 ; if result is zero. Loops to OLTB45 if not. call resetpost44 ; OLTB45a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB45a ; if result is zero. Loops to OLTB45a if not. call resetpost8 ; bcf clk ; OLTB46 call led_seq03 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB46 ; if result is zero. Loops to OLTB46 if not. call resetpost44 ; OLTB46a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB46a ; if result is zero. Loops to OLTB46a if not. call resetpost8 ; bcf clk ; OLTB47 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB47 ; if result is zero. Loops to OLTB47 if not. call resetpost22 ; OLTB47a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post22 and skips the next instruction goto OLTB47a ; if result is zero. Loops to OLTB47a if not. call resetpost8 ; bcf clk ; OLTB48 call led_seq01 ; call d_low ; call one952sec15 ; creates a 15/1952sec delay. decfsz post22,f ; decrements post22 and skips the next instruction. goto OLTB48 ; if result is zero. Loops to OLTB48 if not. call resetpost22 ; OLTB48a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post22 and skips the next instruction goto OLTB48a ; if result is zero. Loops to OLTB48a if not. call resetpost8 ; bcf clk ; OLTB49 call led_seq02 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB49 ; if result is zero. Loops to OLTB49 if not. call resetpost44 ; OLTB49a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB49a ; if result is zero. Loops to OLTB49a if not. call resetpost8 ; bcf clk ; OLTB50 call led_seq03 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB50 ; if result is zero. Loops to OLTB49 if not. call resetpost44 ; OLTB50a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB50a ; if result is zero. Loops to OLTB49a if not. call resetpost8 ; bcf clk ; OLTB51 call led_seq01 ; call d_high ; call one952sec15 ; creates a 15/1952sec delay. decfsz post44,f ; decrements post44 and skips the next instruction. goto OLTB51 ; if result is zero. Loops to OLTB49 if not. call resetpost44 ; OLTB51a call one952sec19 ; creates a 19/1952sec delay. decfsz post8,f ; decrements post8 and skips the next instruction goto OLTB51a ; if result is zero. Loops to OLTB49a if not. call resetpost8 ; bcf clk ; OLTB52 call led_seq02 ; call led_seq04 ; call led_seq05 ; call d_high ; call one952sec9 ; creates a 9/1952sec delay. decfsz post88,f ; decrements post88 and skips the next instruction. goto OLTB52 ; if result is zero. Loops to OLTB49 if not. call resetpost88 ; bcf clk ; call d_low ; bcf clk ; call d_low ; bcf clk ; call d_low ; bcf clk ; call d_low ; bcf clk ; OLTB52a call one952sec19 ; creates a 19/1952sec delay. decfsz post150,f ; decrements post150 and skips the next instruction goto OLTB52a ; if result is zero. Loops to OLTB49a if not. call resetpost150 ; goto Main ; loops to main. end